Description:
OHSSE detects if both sides of a binary expression, or an assignment expression change the value of the same variable. This may cause undesirable program behavior under some circumstances.
OHSSE supports three levels that you can specify in the audit's properties:
Incorrect:
void search(int x[], int n) {
int i = 0;
while (i < n) {
if (x[i++] == x[i++]) {
...
}
}
}
Correct:
void search(int x[], int n) {
int i = 0;
while (i < n) {
if (x[i] == x[i + 1]) {
...
}
i += 2;
}
}